﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Web.BaseCode
{
    public class BaseAdmin : System.Web.UI.Page
    {
        private string username = string.Empty;
        private string pwd = string.Empty;
        //创建进入是加载,第一个加载项,在page_load之前
        protected override void OnInit(EventArgs e)
        {
            if (Session["username"] == null)
            {
                //Response.Write("<script type='text/javascript'>alert('用户超时,请重新登录！');window.location.href='../login.aspx';</script>");
                Response.Redirect("/admin/login.aspx");
            }
            else
            {
                this.username = (string)Session["username"];
            }
        }
    }
}